#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=lsyslog
PKG_REV:=c27308dbf192df43f296fcd751f8285b498e19fa
PKG_VERSION:=5.1-$(PKG_REV)
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git@github.com:remakeelectric/lsyslog.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_BUILD_DEPENDS:=liblua

include $(INCLUDE_DIR)/package.mk

# Can't run tests with host lua and the cross compiled binary.
MAKE_FLAGS+= so

define Package/$(PKG_NAME)
  SUBMENU:=Lua
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=lsyslog
  URL:=http://luaforge.net/projects/lsyslog/
  DEPENDS:=+lua
endef

define Package/$(PKG_NAME)/description
  lsyslog is simple binding API from Lua to syslog.
endef

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/usr/lib/lua
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/syslog.so $(1)/usr/lib/lua
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
